package com.software.project.repository;

import com.software.project.entity.Suit;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Optional;

@Repository
public interface SuitRepository extends JpaRepository<Suit, Integer>, JpaSpecificationExecutor {
    // 查询出已拥有和可解锁的服装
    List<Suit> findBySuitRequireIntelligenceLessThanEqualAndSuitRequirePowerLessThanEqual(int intelligence, int power);
    //查询出不可解锁的服装
    List<Suit> findBySuitRequireIntelligenceGreaterThanOrSuitRequirePowerGreaterThan(int intelligence, int power);
    //根据服装图片路径查找服装对象
    Optional<Suit> findBySuitSrc(String suitImage);
}